<label class="col-sm-2 control-label">{{$uploadTitle}}</label>
<input type="hidden" name="filePath" id="{{$backPath}}" value="{{$editPath}}">
<div class="col-sm-6" style="margin-bottom:20px">
    <a id="{{$bindBtn}}" class="upload_btn"  @if(isset($defaultImg)) style="display: none;" @endif>
        <input type="file" class="add" multiple>
        <span class="upload-title">+</span>
    </a>
    <div  class="{{$showContent}}"  @if(!isset($defaultImg)) style="display: none;" @endif>
        <span style="display: inline-block;position: relative;">
            <img src="{{$defaultImg}}" style="max-width: 100%;">
            <span class="{{$deleteImg or 'delete-img'}} delete-img-style">×</span>
        </span>
    </div>
</div>
<script>
    $("#{{$bindBtn}}").bindUpload({
        url:"/index.php/image/upload",
        callbackPath:"#{{$backPath}}",
        showContent:'.{{$showContent}}',
        num:10,//上传数量的限制 默认为空 无限制
        type:"jpg|png|gif|svg",//上传文件类型 默认为空 无限制
        size:3,//上传文件大小的限制,默认为5单位默认为mb
    });
    @if(isset($deleteImg))
        $(".{{$deleteImg}}").click(function () {
    @else
        $(".delete-img").click(function () {
    @endif
        dialog.confirm("确认删除照片？",function callback(){
            $(".layui-layer-dialog").hide();
            $(".layui-layer-shade").fadeOut();
            $(".{{$showContent}}").hide();
            $("#{{$bindBtn}}").show();
            $("#{{$backPath}}").val('');
        });
    });
</script>